package com.midongtech.news;

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.Nullable;

/**
 * Created by hrs on 2019/4/ 1.
 */

public class ChoiceActivity extends Activity {

    private EditText et_cid;
    private EditText et_cuid;
    private EditText et_imei;
    private EditText et_oaid;



    /**
     * 获取手机型号
     *
     * @return 手机型号
     */
    public static String getSystemModel() {
        return Build.MODEL +"   "+ Build.BOARD;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.choice);
        DeviceUtil.getOaid(this);
        et_cid = findViewById(R.id.et_cid);
        et_cid.setText("20");   //测试cid

        et_cuid = findViewById(R.id.et_cuid);
        et_cuid.setText(DeviceUtil.getAndroidId(this)+"22");  //测试cuid
        et_imei = findViewById(R.id.et_imei);
        et_imei.setText("" + DeviceUtil.getDeviceId(this));


        et_oaid = findViewById(R.id.et_oaid);
        et_oaid.setText(DeviceUtil.getOaid(this));

        DeviceUtil.getDeviceId(this);
//


    }




    public void newsH5(View view) {
        String url = "https://yyz.midongtech.com/#/newsTaskH5?cuid="+et_cuid.getText().toString()+"&imei="+et_imei.getText().toString()+"&oaid="+et_oaid.getText().toString()+"&cid="+et_cid.getText().toString()+"&sdkversion=3.3.2.44";
        url = "https://yyz.midongtech.com/#/newsTaskH5?cuid=userIdtest&imei=861234567&oaid=a4968dc1-e3a2-4cc7-affc-fb9ee15ab614&cid=20&sdkversion=3.3.2.44";
        Intent intent = new Intent(this,MainActivity.class);
        intent.putExtra("newsUrl",url);
        intent.putExtra("newsTitle","新闻赚");
        startActivity(intent);
    }



}
